{extend name="admin@public/base" /}
{block name="main-content"}
	<div class="page-content">

		<div class="row maintop">
			<div class="col-xs-12 col-sm-2">
				<!-- 点击模态框（Modal） -->
				<button class="btn btn-sm btn-danger" data-toggle="modal" data-target="#myModal">
					<i class="ace-icon fa fa-bolt bigger-110"></i>
					添加会员组
				</button>

			</div>
		</div>


		<div class="row">
			<div class="col-xs-12">
				<div>
					<form class="ajaxForm" name="member_group_order" method="post" action="{:url('admin/Member/member_group_order')}" >
						<table class="table table-striped table-bordered table-hover" id="dynamic-table">
							<thead>
							<tr>
								<th>会员组ID</th>
								<th>会员组名称</th>
								<th class="hidden-sm hidden-xs">满足积分条件</th>
								<th style="border-right:#CCC solid 1px;">状态</th>
								<th style="border-right:#CCC solid 1px;">排序</th>
								<th style="border-right:#CCC solid 1px;">操作</th>
							</tr>
							</thead>

							<tbody>

							{foreach name="member_group_list" item="v"}
								<tr>
									<td height="28" >{$v.member_group_id}</td>
									<td>{$v.member_group_name}</td>
									<td class="hidden-sm hidden-xs">{$v.member_group_bomlimit} - {$v.member_group_toplimit} 积分</td>
									<td>
										{if condition='$v.member_group_open eq 1'}
											<a class="red open-btn" href="{:url('admin/Member/member_group_state')}" data-id="{$v.member_group_id}" title="已开启">
												<div id="zt{$v.member_group_id}"><button class="btn btn-minier btn-yellow">开启</button></div>
											</a>
											{else/}
											<a class="red open-btn" href="{:url('admin/Member/member_group_state')}" data-id="{$v.member_group_id}" title="已禁用">
												<div id="zt{$v.member_group_id}"><button class="btn btn-minier btn-danger">禁用</button></div>
											</a>
										{/if}														</td>
									<td><input name="{$v.member_group_id}" value="{$v.member_group_order}" class="list_order center"/></td>
									<td>
										<div class="hidden-sm hidden-xs action-buttons">
											<a class="green memberedit-btn"  href="{:url('admin/Member/member_group_edit')}" data-id="{$v.member_group_id}" title="修改">
												<i class="ace-icon fa fa-pencil bigger-130"></i>
											</a>
											<a class="red confirm-rst-url-btn" href="{:url('admin/Member/member_group_del',array('member_group_id'=>$v['member_group_id']))}" data-info="你确定要删除吗？" title="删除">
												<i class="ace-icon fa fa-trash-o bigger-130"></i>
											</a>
										</div>
										<div class="hidden-md hidden-lg">
											<div class="inline position-relative">
												<button class="btn btn-minier btn-primary dropdown-toggle" data-toggle="dropdown" data-position="auto">
													<i class="ace-icon fa fa-cog icon-only bigger-110"></i>
												</button>
												<ul class="dropdown-menu dropdown-only-icon dropdown-yellow dropdown-menu-right dropdown-caret dropdown-close">
													<li>
														<a href="{:url('admin/Member/member_group_edit')}" data-id="{$v.member_group_id}" class="tooltip-success memberedit-btn" data-rel="tooltip" title="" data-original-title="修改">
																	<span class="green">
																		<i class="ace-icon fa fa-pencil bigger-120"></i>
																	</span>
														</a>
													</li>

													<li>
														<a href="{:url('admin/Member/member_group_del',array('member_group_id'=>$v['member_group_id']))}"  class="tooltip-error confirm-rst-url-btn" data-info="你确定要删除吗？" data-rel="tooltip" title="" data-original-title="删除">
																	<span class="red">
																		<i class="ace-icon fa fa-trash-o bigger-120"></i>
																	</span>
														</a>
													</li>
												</ul>
											</div>
										</div>
									</td>
								</tr>
							{/foreach}
							<tr>
								<td colspan="8" align="left"><button type="submit"  id="btnorder" class="btn btn-white btn-yellow btn-sm">排序</button></td>
							</tr>

							</tbody>
						</table>
					</form>
				</div>
			</div>
		</div>
	</div><!-- /.page-content -->



		<!-- 显示模态框（Modal） -->
		<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
			<form class="form-horizontal ajaxForm2" name="member_group_runadd" method="post" action="{:url('admin/Member/member_group_runadd')}">
				<div class="modal-dialog">
					<div class="modal-content">
						<div class="modal-header">
							<button type="button" class="close" data-dismiss="modal"
									aria-hidden="true">×
							</button>
							<h4 class="modal-title" id="myModalLabel">
								添加会员组
							</h4>
						</div>
						<div class="modal-body">


							<div class="row">
								<div class="col-xs-12">

									<div class="form-group">
										<label class="col-sm-2 control-label no-padding-right" for="form-field-1"> 会员组名称：  </label>
										<div class="col-sm-10">
											<input type="text" name="member_group_name" id="member_group_name" placeholder="输入会员组名称" class="col-xs-10 col-sm-5" required/>
										</div>
									</div>
									<div class="space-4"></div>

									<div class="form-group">
										<label class="col-sm-2 control-label no-padding-right" for="form-field-1"> 积分条件：  </label>
										<div class="col-sm-10">

										<span class="input-icon">
											<input type="number" id="form-field-icon-1" name="member_group_bomlimit" placeholder="输入下限积分"  required/>
											<i class="ace-icon fa fa-leaf blue"></i>
										</span>

										<span class="input-icon input-icon-right">
											<input type="number" id="form-field-icon-2" name="member_group_toplimit" placeholder="输入上限积分"  required/>
											<i class="ace-icon fa fa-leaf green"></i>
										</span>

											<!-- /section:elements.form.input-icon -->
										</div>
									</div>
									<div class="space-4"></div>

									<div class="form-group">
										<label class="col-sm-2 control-label no-padding-right" for="form-field-1"> 排序：  </label>
										<div class="col-sm-10">
											<input type="text" name="member_group_order" id="member_group_order" value="50" class="col-xs-10 col-sm-3" />
											<span class="lbl">&nbsp;&nbsp;<span class="red">*</span>从小到大排序</span>
										</div>
									</div>
									<div class="space-4"></div>

									<div class="form-group">
										<label class="col-sm-2 control-label no-padding-right" for="form-field-1"> 是否开启： </label>
										<div class="col-sm-10" style="padding-top:5px;">
											<input name="member_group_open" id="member_group_open" value="1" class="ace ace-switch ace-switch-4 btn-flat" type="checkbox" />
											<span class="lbl">&nbsp;&nbsp;默认关闭</span>
										</div>
									</div>
									<div class="space-4"></div>

								</div>
							</div>




						</div>
						<div class="modal-footer">
							<button type="submit" class="btn btn-primary">
								提交保存
							</button>
							<button class="btn btn-info" type="reset">
								重置
							</button>
							<button type="button" class="btn btn-default" data-dismiss="modal">
								关闭
							</button>
						</div>
					</div><!-- /.modal-content -->
				</div><!-- /.modal-dialog -->
			</form>
		</div><!-- /.modal -->


		<!-- 显示模态框（Modal） -->
		<div class="modal fade in" id="myModaledit" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
			<div class="modal-backdrop fade in" id="gbbb" style="height: 100%;"></div>
			<form class="form-horizontal ajaxForm2" name="member_group_runedit" method="post" action="{:url('admin/Member/member_group_runedit')}">
				<input type="hidden" name="member_group_id" id="editmember_group_id" value="" />
				<div class="modal-dialog">
					<div class="modal-content">
						<div class="modal-header">
							<button type="button" class="close" id="gb"  data-dismiss="modal"
									aria-hidden="true">×
							</button>
							<h4 class="modal-title" id="myModalLabel">
								修改用户组
							</h4>
						</div>
						<div class="modal-body">


							<div class="row">
								<div class="col-xs-12">

									<div class="form-group">
										<label class="col-sm-2 control-label no-padding-right" for="form-field-1"> 会员组名称：  </label>
										<div class="col-sm-10">
											<input type="text" name="member_group_name" id="editmember_group_name" value="" class="col-xs-10 col-sm-5"  required/>
										</div>
									</div>
									<div class="space-4"></div>

									<div class="form-group">
										<label class="col-sm-2 control-label no-padding-right" for="form-field-1"> 积分条件：  </label>
										<div class="col-sm-10">

											<span class="input-icon">
												<input type="number" id="editmember_group_bomlimit" name="member_group_bomlimit" placeholder="输入下限积分" required/>
												<i class="ace-icon fa fa-leaf blue"></i>
											</span>

											<span class="input-icon input-icon-right">
												<input type="number" id="editmember_group_toplimit" name="member_group_toplimit" placeholder="输入上限积分" required/>
												<i class="ace-icon fa fa-leaf green"></i>
											</span>

											<!-- /section:elements.form.input-icon -->
										</div>
									</div>
									<div class="space-4"></div>

									<div class="form-group">
										<label class="col-sm-2 control-label no-padding-right" for="form-field-1"> 排序：  </label>
										<div class="col-sm-10">
											<input type="text" name="member_group_order" id="editmember_group_order" value="50" class="col-xs-10 col-sm-3" />
											<span class="lbl">&nbsp;&nbsp;<span class="red">*</span>从小到大排序</span>
										</div>
									</div>
									<div class="space-4"></div>

								</div>
							</div>



						</div>
						<div class="modal-footer">
							<button type="submit" class="btn btn-primary">
								提交保存
							</button>
							<button type="button" class="btn btn-default"  id="gbb" >
								关闭
							</button>
						</div>
					</div><!-- /.modal-content -->
				</div><!-- /.modal-dialog -->
			</form>
		</div><!-- /.modal -->
{/block}
